package org.upo.eps.it.phama.bean;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class DetallePedProId implements Serializable {
    
    @Column(name = "ID_DETALLE", nullable = false)
    private int idDetalle;
    
    @Column(name = "ID_PEDIDO_PRO", nullable = false)
    private int idPedidoPro;

    //<editor-fold defaultstate="collapsed" desc="constructors">
    public DetallePedProId() {
    }
    
    public DetallePedProId(int idDetalle, int idPedidoPro) {
        this.idDetalle = idDetalle;
        this.idPedidoPro = idPedidoPro;
    }
    //</editor-fold>
    
    //<editor-fold defaultstate="collapsed" desc="getters & setters">
    public int getIdDetalle() {
        return this.idDetalle;
    }
    
    public void setIdDetalle(int idDetalle) {
        this.idDetalle = idDetalle;
    }
    
    public int getIdPedidoPro() {
        return this.idPedidoPro;
    }
    
    public void setIdPedidoPro(int idPedidoPro) {
        this.idPedidoPro = idPedidoPro;
    }
    //</editor-fold>
    
    @Override
    public boolean equals(Object other) {
        if ((this == other)) {
            return true;
        }
        if ((other == null)) {
            return false;
        }
        if (!(other instanceof DetallePedProId)) {
            return false;
        }
        DetallePedProId castOther = (DetallePedProId) other;        
        
        return (this.getIdDetalle() == castOther.getIdDetalle())
                && (this.getIdPedidoPro() == castOther.getIdPedidoPro());
    }
    
    @Override
    public int hashCode() {
        int result = 17;
        
        result = 37 * result + this.getIdDetalle();
        result = 37 * result + this.getIdPedidoPro();
        return result;
    }    
}
